package br.com.dponto.endereco;

import br.com.dponto.util.DAOFactory;

public class EnderecoRN {

	private EnderecoDAO enderecoDAO;

	public EnderecoRN() {
		this.enderecoDAO = DAOFactory.criarEnderecoDAO();
	}

	public void salvar(Endereco endereco) {

		Integer codigo = endereco.getCodigo();
		if (codigo == null || codigo == 0) {
			this.enderecoDAO.salvar(endereco);
		} else {
			this.enderecoDAO.alterar(endereco);
		}

	}

}
